/*
 * @Author: huangyq
 * @Date: 2022-04-25 17:45:24
 * @LastEditTime: 2022-05-24 14:36:36
 * @LastEditors: huangyq
 * @Description: 数据接口
 * @FilePath: /haotian-operation-manage-system-pc-client/src/components/qt3-form/interface.ts
 */

interface IApis {
  name: string
  autoFill: boolean
  obj: Record<string, any> | null
}

interface IAlias {
  label: string
  value: string
  data: string
}

export interface IBaseFieldItem {
  prop: string
  type: string
  label?: string
  slot?: boolean
  oSlot?: boolean
  placeholder?: string
  attrs?: Record<string, string | number | boolean>
  options?: Record<string, number | string>[]
  events?: Record<string, (v: string | number | Event) => void>
  min?: number
  max?: number
  unit?: string
}

export interface IInputFieldItem extends IBaseFieldItem {
  type: 'input'
}

export interface IInputNumberFieldItem extends IBaseFieldItem {
  type: 'inputNumber'
}
export interface IDatepickerItem extends IBaseFieldItem {
  type: 'datepicker'
}

export interface ISelectFieldItem extends IBaseFieldItem {
  type: 'select'
  alias?: IAlias
  options: Record<string, number | string>[]
}
